// pages/kefu.js
Page({
  /**
   * 页面的初始数据
   */
  data: {
    top: 0,
    opacity: 0,
    scrollTop: 0.5,
    banner:'',
    article: []
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
    this.load();
  },

  detail(e){
    let id=e.currentTarget.dataset.id;
    wx.navigateTo({
      url: '/pages/articleDetail/articleDetail?id='+id
    })
  },
  async load(){
    let res=await wx.util.post("article/wenti");
    this.setData({
      article:res.data.list,
      banner:res.data.banner
    })
  },
  back(){
    wx.navigateBack()
  },
  onPageScroll(e) {
    this.setData({
      scrollTop:e.scrollTop
    })
  },
  initNavigation(e) {
    this.setData({
      opacity:e.detail.opacity,
      top:e.detail.top
    })
  },
  opacityChange(e) {
    this.setData({
      opacity:e.detail.opacity
    })
  }

})